home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_300 / 353_02 / usedttm.cpp < prev    next >
C/C++ Source or Header  |  1992-01-18  |  976b  |  31 lines

  1.                                      // Chapter 9 - Program 5
  2. #include <iostream.h>
  3. #include "datetime.h"
  4.  
  5. datetime now, birthday(10, 18, 1938,  1, 30, 17);
  6. datetime       special( 2, 19, 1950, 13, 30,  0);
  7.  
  8. void main(void)
  9. {
  10.  
  11.    cout << "Now = " << now.get_date_string() << " "
  12.                     << now.get_time_string() << " and is day "
  13.                     << now.get_day_of_year() << "\n";
  14.  
  15.    cout << "Birthday = " << birthday.get_date_string() << " "
  16.                     << birthday.get_time_string() << " and is day "
  17.                     << birthday.get_day_of_year() << "\n";
  18.  
  19.    cout << "Special = " << special.get_date_string() << " "
  20.                     << special.get_time_string() << " and is day "
  21.                     << special.get_day_of_year() << "\n";
  22.  
  23. }
  24.  
  25.  
  26.  
  27. // Result of execution
  28.  
  29. // Now = Jan 20, 1992 21:12:56 and is day 20
  30. // Birthday = Oct 18, 1938  1:30:17 and is day 291
  31. // Special = Feb 19, 1950 13:30:00 and is day 50